
public class CustomerDemoWithGetSet {

	public static void main(String[] args) {
     CustomerWithGetSet customer= new CustomerWithGetSet();
		
		String customername= "ReenuKhurana";
		int custid=1;
		int age=25;
		String address="dallas,tx";
		String phonenumber="9872727222";
		String email="reenu@gmail.com";
		String username="reenu";
		String password="reenupass1";
		
		
				
	    boolean customerexist=customer.checkCustomer(email);
	    if (customerexist == true)
	    {
	    	System.out.println("This email id already exists");
	    	System.out.println("please login.");
	    }
	    else
	    {
	    	System.out.println("Please sign Up");
	    }
	    
		System.out.println("");
		
		// here customer is signed up
		
		if(email!=customer.getCustEmail())
		{
		customer.setCustId(custid);
		customer.setCustName(customername);
		customer.setCustUsername(username);
		customer.setCustPassword(password);
		customer.setCustAddress(address);
		customer.setCustAge(age);
		customer.setCustEmail(email);
		customer.setCustPhone(phonenumber);
		}
		
		//here customer is logging in
				if((customer.getCustUsername().equalsIgnoreCase(username) ) && (customer.getCustPassword().equalsIgnoreCase(password)))
				{
					customer.setLoggedIn(true);
					System.out.println("welcome  " + username);
					System.out.println();
				}
				else
				{
					customer.setLoggedIn(false);
					System.out.println("Username and password doesn't match. \n");
				}
			
		
       
		//here customer info is retrieved
	
				
				
	   if (email==customer.getCustEmail())
	   {
		System.out.println("Customer Id: " + customer.getCustId());
		System.out.println("Customer Name: " + customer.getCustName());
		System.out.println("username: " + customer.getCustUsername());
		System.out.println("password: " + customer.getCustPassword());
		System.out.println("Address: " + customer.getCustAddress());
		System.out.println("Age: " + customer.getCustAge());
		System.out.println("Email: " + customer.getCustEmail());
		System.out.println("phone: " + customer.getCustPhone());
	   }
		System.out.println();
		
		
		//here customer has been deleted
		if (custid==customer.getCustId())
		{
			customer.setCustId(0);
			customer.setCustName("");
			customer.setCustUsername("");
			customer.setCustPassword("");
			customer.setCustAddress("");
			customer.setCustAge(0);
			customer.setCustEmail("");
			customer.setCustPhone("");
			System.out.println("customer with customer id: "+ custid + " has been deleted");
		}
		
		}
	
		
	}

		



